package work.mediway.mdm.core.vo;

import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/1/12
 */
@ApiModel(value = "字典表")
@Setter
@ToString
public class BaseCtVO {

    @ApiModelProperty(value = "唯一主键")
    private String businessRowId;

    @Getter
    @ApiModelProperty(value = "编号")
    private String rowId;


    public String getBusinessRowId() {
        if (StrUtil.containsIgnoreCase(businessRowId, "_")) {
            return StrUtil.splitToArray(businessRowId, "_")[1];
        }
        return businessRowId;
    }
}
